package com.ruoyi.statistic.service.impl;

import com.ruoyi.statistic.domain.StatisticStudentEmploymentInfo;
import com.ruoyi.statistic.domain.vo.KeyValueVo;
import com.ruoyi.statistic.domain.vo.TopNVo;
import com.ruoyi.statistic.mapper.StatisticStudentEmploymentInfoMapper;
import com.ruoyi.statistic.service.IStatisticStudentEmploymentInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;


@Service
public class StatisticStudentEmploymentInfoServiceImpl implements IStatisticStudentEmploymentInfoService {


    @Resource
    private StatisticStudentEmploymentInfoMapper statisticStudentEmploymentInfoMapper;


    /**
     * 查询就业数据管理
     *
     * @param id 就业数据管理主键
     * @return 就业数据管理
     */
    @Override
    public StatisticStudentEmploymentInfo selectStatisticStudentEmploymentInfoById(Long id) {
        return statisticStudentEmploymentInfoMapper.selectStatisticStudentEmploymentInfoById(id);
    }

    /**
     * 查询就业数据管理列表
     *
     * @param studentEmploymentInfo 就业数据管理
     * @return 就业数据管理
     */
    @Override
    public List<StatisticStudentEmploymentInfo> selectStatisticStudentEmploymentInfoList(StatisticStudentEmploymentInfo studentEmploymentInfo) {
        return statisticStudentEmploymentInfoMapper.selectStatisticStudentEmploymentInfoList(studentEmploymentInfo);
    }

    /**
     * 判断是否存在指定日期的文件
     *
     * @param date
     * @return
     */
    public List<StatisticStudentEmploymentInfo> selectStatisticStudentEmploymentInfoByDate(Date date) {
        return statisticStudentEmploymentInfoMapper.selectStatisticStudentEmploymentInfoByDate(date);
    }

    /**
     * 新增就业数据管理
     *
     * @param studentEmploymentInfo 就业数据管理
     * @return 结果
     */
    @Override
    public int insertStatisticStudentEmploymentInfo(StatisticStudentEmploymentInfo studentEmploymentInfo) {
        return statisticStudentEmploymentInfoMapper.insertStatisticStudentEmploymentInfo(studentEmploymentInfo);
    }

    /**
     * 修改就业数据管理
     *
     * @param studentEmploymentInfo 就业数据管理
     * @return 结果
     */
    @Override
    public int updateStatisticStudentEmploymentInfo(StatisticStudentEmploymentInfo studentEmploymentInfo) {
        return statisticStudentEmploymentInfoMapper.updateStatisticStudentEmploymentInfo(studentEmploymentInfo);
    }

    /**
     * 批量删除就业数据管理
     *
     * @param ids 需要删除的就业数据管理主键
     * @return 结果
     */
    @Override
    public int deleteStatisticStudentEmploymentInfoByIds(Long[] ids) {
        return statisticStudentEmploymentInfoMapper.deleteStatisticStudentEmploymentInfoByIds(ids);
    }

    /**
     * 删除就业数据管理信息
     *
     * @param id 就业数据管理主键
     * @return 结果
     */
    @Override
    public int deleteStatisticStudentEmploymentInfoById(Long id) {
        return statisticStudentEmploymentInfoMapper.deleteStatisticStudentEmploymentInfoById(id);
    }


    /**
     * 判断指定日期的数据是否存在
     *
     * @return
     */
//    public boolean checkStatisticStudentEmploymentInfoAnyByDate(Date date) {
//        return studentEmploymentInfoMapper.checkStatisticStudentEmploymentInfoAnyByDate(date) > 0;
//    }


    /**
     * 判断添加日期的数据是否存在
     *
     * @return
     */
    public boolean checkStatisticStudentEmploymentInfoByDate(String year, Date date) {
        return statisticStudentEmploymentInfoMapper.checkStatisticStudentEmploymentInfoByDate(year, date) > 0;
    }


    /**
     * @param year
     * @param date
     * @return
     */
    public int deleteStatisticStudentEmploymentInfoByDate(String year, Date date) {
        return statisticStudentEmploymentInfoMapper.deleteStatisticStudentEmploymentInfoByDate(year, date);
    }


    /**
     * 学生就业聚合统计（汇总）
     *
     * @param employmentAggregationSearchParamVo
     * @return
     */
//    public EmploymentAggregationVo employmentAggregation(EmploymentAggregationSearchParamVo employmentAggregationSearchParamVo) {
//        return employmentStatisticMapper.employmentAggregation(employmentAggregationSearchParamVo);
//    }


    /**
     * 学生就业统计（按系别划分）
     *
     * @param employmentDepartmentDivideSearchParamVo
     * @return
     */
//    public List<EmploymentDepartmentDivideVo> employmentDepartmentDivide(EmploymentDepartmentDivideSearchParamVo employmentDepartmentDivideSearchParamVo) {
//        return employmentStatisticMapper.employmentDepartmentDivide(employmentDepartmentDivideSearchParamVo);
//    }


    /**
     * 学生就业统计（按专业划分）
     *
     * @param employmentMajorDivideSearchParamVo
     * @return
     */
//    public List<EmploymentMajorDivideVo> employmentMajorDivide(EmploymentMajorDivideSearchParamVo employmentMajorDivideSearchParamVo) {
//        return employmentStatisticMapper.employmentMajorDivide(employmentMajorDivideSearchParamVo);
//    }


    /**
     * 学生就业统计（按组织划分）
     *
     * @param employmentGroupDivideSearchParamVo
     * @return
     */
//    public List<EmploymentGroupDivideVo> employmentGroupDivide(EmploymentGroupDivideSearchParamVo employmentGroupDivideSearchParamVo) {
//        return employmentStatisticMapper.employmentGroupDivide(employmentGroupDivideSearchParamVo);
//    }


    /**
     * 学生就业统计（按辅导员划分）
     *
     * @param employmentCounsellorDivideSearchParamVo
     * @return
     */
//    public List<EmploymentCounsellorDivideVo> employmentCounsellorDivide(EmploymentCounsellorDivideSearchParamVo employmentCounsellorDivideSearchParamVo) {
//        return employmentStatisticMapper.employmentCounsellorDivide(employmentCounsellorDivideSearchParamVo);
//    }


    /**
     * 获取前N名的系别
     *
     * @param vo
     * @return
     */
    public List<KeyValueVo> selectTopNDepartment(TopNVo vo) {
        return statisticStudentEmploymentInfoMapper.selectTopNDepartment(vo);
    }


    /**
     * 获取前N名的辅导员
     *
     * @param vo
     * @return
     */
    public List<KeyValueVo> selectTopNCounsellor(TopNVo vo) {
        return statisticStudentEmploymentInfoMapper.selectTopNCounsellor(vo);
    }


    /**
     * 获取前N名的组织
     *
     * @param vo
     * @return
     */
    public List<KeyValueVo> selectTopNGroup(TopNVo vo) {
        return statisticStudentEmploymentInfoMapper.selectTopNGroup(vo);
    }

}
